/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.cinfo.siga.datos;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author alumno
 */
@Embeddable
public class AsistenciaPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "UNI_COD")
    private short uniCod;
    @Basic(optional = false)
    @Column(name = "PER_COD")
    private int perCod;
    @Basic(optional = false)
    @Column(name = "PER_UNI_COD")
    private int perUniCod;
    @Basic(optional = false)
    @Column(name = "ASI_FECH")
    @Temporal(TemporalType.DATE)
    private Date asiFech;
    @Basic(optional = false)
    @Column(name = "ASI_INI")
    @Temporal(TemporalType.TIME)
    private Date asiIni;

    public AsistenciaPK() {
    }

    public AsistenciaPK(short uniCod, int perCod, int perUniCod, Date asiFech, Date asiIni) {
        this.uniCod = uniCod;
        this.perCod = perCod;
        this.perUniCod = perUniCod;
        this.asiFech = asiFech;
        this.asiIni = asiIni;
    }

    public short getUniCod() {
        return uniCod;
    }

    public void setUniCod(short uniCod) {
        this.uniCod = uniCod;
    }

    public int getPerCod() {
        return perCod;
    }

    public void setPerCod(int perCod) {
        this.perCod = perCod;
    }

    public int getPerUniCod() {
        return perUniCod;
    }

    public void setPerUniCod(int perUniCod) {
        this.perUniCod = perUniCod;
    }

    public Date getAsiFech() {
        return asiFech;
    }

    public void setAsiFech(Date asiFech) {
        this.asiFech = asiFech;
    }

    public Date getAsiIni() {
        return asiIni;
    }

    public void setAsiIni(Date asiIni) {
        this.asiIni = asiIni;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) uniCod;
        hash += (int) perCod;
        hash += (int) perUniCod;
        hash += (asiFech != null ? asiFech.hashCode() : 0);
        hash += (asiIni != null ? asiIni.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AsistenciaPK)) {
            return false;
        }
        AsistenciaPK other = (AsistenciaPK) object;
        if (this.uniCod != other.uniCod) {
            return false;
        }
        if (this.perCod != other.perCod) {
            return false;
        }
        if (this.perUniCod != other.perUniCod) {
            return false;
        }
        if ((this.asiFech == null && other.asiFech != null) || (this.asiFech != null && !this.asiFech.equals(other.asiFech))) {
            return false;
        }
        if ((this.asiIni == null && other.asiIni != null) || (this.asiIni != null && !this.asiIni.equals(other.asiIni))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.cinfo.siga.datos.AsistenciaPK[ uniCod=" + uniCod + ", perCod=" + perCod + ", perUniCod=" + perUniCod + ", asiFech=" + asiFech + ", asiIni=" + asiIni + " ]";
    }
    
}
